# -*- coding:utf-8 -*-
# @FileName  :ent_credit_user.py
# @Time      :2020/11/26 9:37
# @Author    :Zhoujirong
# @Desc      :
from common.http_request import Request
from common.log import Log
from biz.support.urls import ServerUrl
class EntCreditUserRequest:
    '''企业征信用户管理'''
    @classmethod
    def ent_credit_user_create(cls,creditName,creditUser,creditOrgCode,creditPassword,deptCode,
                   userClass,digitalCertificate,userType,remarks,userStatus,cookie):
        data = {
            'creditName': creditName,
            'creditUser': creditUser,
            'creditOrgCode': creditOrgCode,
            'creditPassword': creditPassword,
            'deptCode': deptCode,
            'userClass': userClass,
            'digitalCertificate': digitalCertificate,
            'userType': userType,
            'remarks': remarks,
            'userStatus': userStatus
        }
        req = Request(ServerUrl.credit_ent_user_create_url,data=data,headers=cookie)
        return req.post()

    @classmethod
    def get_page(cls,curPage,maxSize,search_LIKE_creditName,search_LIKE_creditUser,
                    search_LIKE_creditOrgCode,search_EQ_userClass,search_IN_deptCode,
                    search_EQ_userStatus,cookie):
        data = {
            'curPage': curPage,
            'maxSize': maxSize,
            'search_LIKE_creditName': search_LIKE_creditName,
            'search_LIKE_creditUser': search_LIKE_creditUser,
            'search_LIKE_creditOrgCode': search_LIKE_creditOrgCode,
            'search_EQ_userClass': search_EQ_userClass,
            'search_IN_deptCode': search_IN_deptCode,
            'search_EQ_userStatus': search_EQ_userStatus
        }
        req = Request(ServerUrl.credit_ent_user_getpage_url, params=data, headers=cookie)
        return req.get()

    @classmethod
    def ent_detail(cls, id, cookie):
        data = {
            'id': id
        }
        req = Request(ServerUrl.credit_ent_detail_url, data=data, headers=cookie)
        return req.post()

    @classmethod
    def ent_update(cls, createDate,
                   createUser,
                   creditName,
                   creditOrgCode,
                   creditPassword,
                   creditUser,
                   deptCode,
                   digitalCertificate,
                   ext1,
                   ext2,
                   ext3,
                   ext4,
                   ext5,
                   ext6,
                   id,
                   initFlag,
                   isPollingGroup,
                   machineCPU,
                   machineDisk,
                   machineNetwork,
                   modifyType,
                   passwordUpdateTime,
                   pollingGroupId,
                   rangeOfAction,
                   resCode,
                   resMsg,
                   serialNumber,
                   updateDate,
                   updateOrg,
                   updateUser,
                   userClass,
                   userStatus,
                   userType,
                   whiteList,
                   orgTree,
                   remarks, cookie):
        data = {
            'createDate': createDate,
            'createUser': createUser,
            'creditName': creditName,
            'creditOrgCode': creditOrgCode,
            'creditPassword': creditPassword,
            'creditUser': creditUser,
            'deptCode': deptCode,
            'digitalCertificate': digitalCertificate,
            'ext1': ext1,
            'ext2': ext2,
            'ext3': ext3,
            'ext4': ext4,
            'ext5': ext5,
            'ext6': ext6,
            'id': id,
            'initFlag': initFlag,
            'isPollingGroup': isPollingGroup,
            'machineCPU': machineCPU,
            'machineDisk': machineDisk,
            'machineNetwork': machineNetwork,
            'modifyType': modifyType,
            'passwordUpdateTime': passwordUpdateTime,
            'pollingGroupId': pollingGroupId,
            'rangeOfAction': rangeOfAction,
            'resCode': resCode,
            'resMsg': resMsg,
            'serialNumber': serialNumber,
            'updateDate': updateDate,
            'updateOrg': updateOrg,
            'updateUser': updateUser,
            'userClass': userClass,
            'userStatus': userStatus,
            'userType': userType,
            'whiteList': whiteList,
            'orgTree': orgTree,
            'remarks': remarks
        }



        req = Request(ServerUrl.credit_per_update_url, data=data, headers=cookie)
        return req.post()

    @classmethod
    def ent_del(cls, id, cookie):
        '''
        删除
        :param id:
        :param cookie:
        :return:
        '''
        data = {
            'id': id
        }
        req = Request(ServerUrl.credit_per_user_del_url, data=data, headers=cookie)
        return req.post()




if __name__ == "__main__":
    pass